package com.sc.nft.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoTransfer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.vo.DaoTransferDetailVO;
import com.sc.nft.enums.ApprovalStatusEnum;
import com.sc.nft.enums.WalletChannelEnum;
import com.sc.nft.enums.wallet.DaoTransferTypeEnum;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 企业转账表(sc_dao_transfer)数据Mapper
 *
 * @author zxy
 * @since 2023-12-21 15:18:22
 * @description 由 Mybatisplus Code Generator 创建
*/
@Mapper
public interface DaoTransferMapper extends BaseMapper<DaoTransfer> {

    Page<DaoTransferDetailVO> getRecords(Page page , @Param("daoId") Long daoId,@Param("scence") Integer scence,@Param("type") Integer type, @Param("applyTel") String applyTel,
                                         @Param("marketAccount") String marketAccount, @Param("walletChannel") Integer walletChannel,
                                         @Param("status") Integer status, @Param("startTime") Date startTime,@Param("endTime") Date endTime);


    @Select("select ifnull(sum(amount),0) from sc_dao_transfer where status=4 and create_time between #{startTime} and #{endTime}")
    String getSumSuccessAmount(@Param("startTime")Date startTime,@Param("endTime") Date endTime);
}
